
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="studentStart.jsp"%>
<div class="main-content">
    <%-- 用户反馈提交表单 --%>
    <div class="feedback-form">
        <h2>提交用户反馈</h2>
        <form action="smartfeedback.jsp" method="post">
            <div class="form-group">
                <label for="name">姓名：</label>
                <input type="text" class="form-control" id="name" name="name" required>
            </div>
            <div class="form-group">
                <label for="email">邮箱：</label>
                <input type="email" class="form-control" id="email" name="email" required>
            </div>
            <div class="form-group">
                <label for="rating">评分：</label>
                <select class="form-control" id="rating" name="rating" required>
                    <option value="1">1</option>
                    <option value="2">2</option>
                    <option value="3">3</option>
                    <option value="4">4</option>
                    <option value="5" selected>5</option>
                </select>
            </div>
            <div class="form-group">
                <label for="category">反馈分类：</label>
                <select class="form-control" id="category" name="category" required>
                    <option value="bug">技术问题</option>
                    <option value="suggestion">建议</option>
                    <option value="content">课程内容</option>
                    <option value="general">其他</option>
                </select>
            </div>
            <div class="form-group">
                <label for="message">反馈内容：</label>
                <textarea class="form-control" id="message" name="message" rows="4" required></textarea>
            </div>
            <button type="submit" class="btn btn-primary">提交反馈</button>
        </form>
    </div>

    <%-- 实时反馈展示 --%>
    <div class="real-time-feedback">
        <h2>实时反馈</h2>
        <div id="feedbackList" class="feedback-list">
            <%-- 这里将通过JavaScript动态加载反馈内容 --%>
        </div>
    </div>

    <%-- 用户评价统计 --%>
    <div class="user-reviews-stats">
        <h2>用户评价统计</h2>
        <div class="stats-container">
            <div class="stat-item">
                <h3>平均评分</h3>
                <p id="averageRating">4.5</p>
            </div>
            <div class="stat-item">
                <h3>总反馈数</h3>
                <p id="totalFeedbacks">123</p>
            </div>
            <div class="stat-item">
                <h3>最新反馈</h3>
                <p id="latestFeedback">用户李四在1小时前提交了反馈。</p>
            </div>
        </div>
    </div>
</div>

<%-- 底部信息有作者信息等--%>
<div class="footer">
    <p>© 2025 乡村教育平台 版权所有</p>
    <p>备案号：XXICP备XXXXXX号 | 联系电话：400-XXX-XXXX</p>
    <p>技术支持：XX科技团队</p>
    <p><a href="https://beian.miit.gov.cn/">XXICP备XXXXXX号</a></p>
</div>
</div>

<script>
    $(document).ready(function() {
        // 确保页面加载后搜索框对齐
        $('.search-container').css('margin-top', $('.nav-container').outerHeight() + 'px');

        // 动态加载实时反馈内容
        function loadFeedbacks() {
            $.ajax({
                url: "getFeedbacks.jsp",
                method: "GET",
                success: function(data) {
                    $('#feedbackList').html(data);
                }
            });
        }

        loadFeedbacks();
        setInterval(loadFeedbacks, 30000); // 每30秒更新一次反馈内容
    });
</script>
</body>
</html>